package com.example.handler;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.Button;

import com.example.handler.overflow.Empty_Handler;
import com.example.handler.overflow.Static_Handler;

import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button handler_UI_Button = (Button) findViewById(R.id.handler_UI_Button);
        Button handler_Thread_Button = (Button) findViewById(R.id.handler_Thread_Button);
        Button static_Handler = (Button) findViewById(R.id.static_Handler);
        Button empty_Handler = (Button) findViewById(R.id.empty_Handler);

        handler_UI_Button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Handler_UI.class);
                startActivity(intent);
            }
        });

        handler_Thread_Button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Handler_Thread.class);
                startActivity(intent);
            }
        });
        static_Handler.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Static_Handler.class);
                startActivity(intent);
            }
        });
        empty_Handler.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, Empty_Handler.class);
                startActivity(intent);
            }
        });
    }

}